Quantitative Behavioural Reasoning for Higher-order Effectful Programs: Applicative Distances (Extended Version)
نویسنده
چکیده
Behavioural preorders and equivalences for higher-order languages have been extensively studied in the last decades, often leading to rich and satisfactory theories. However, in presence of effectful computations ordinary behavioural relations can be too discriminating, as highlighted by probabilistic higher-order languages. An elegant way to avoid such problem is to move from qualitative, boolean-valued relations to quantitative relations describing weakened notions of metrics. This paper studies the quantitative refinements of Absramsky’s applicative similarity and bisimilarity in the context of a generalisation of Fuzz, a call-by-value λ-calculus with a linear type system that can express program sensitivity, enriched with algebraic operations à la Plotkin and Power. To do so a general, abstract framework for studying behavioural relations taking values over quantales—algebraic structures representing sets of abstract quantities—is defined according to Lawvere’s analysis of generalised metric spaces. Barr’s notion of relator (or lax extension) is then extended to quantale-valued relations adapting and extending results from the field of monoidal topology. An abstract notion of quantalevalued effectful applicative similarity is then defined and proved to be a compatible generalised metric (in the sense of Lawvere). Notions of quantale-valued applicative bisimilarity and two-way similarity are also defined and proved to be compatible symmetric generalised metrics (viz. pseudometrics) under mild conditions. The resulting theory refines the existing theory of effectful applicative similarity and can be instantiated to come up with applicative distances for concrete calculi. A remarkable example is given by the probabilistic instantiation of Fuzz where a compatible probabilistic applicative distance based on the Wasserstein-Kantorovich distance is obtained. To the best of the author’s knowledge this is the first example of a (non-trivial) compatible applicative distance for a universal (i.e. Turing complete) probabilistic λ-calculus.
منابع مشابه
Equational Reasoning with Applicative Functors
In reasoning about effectful computations, it often suffices to focus on the effect-free parts. We present a package for automatically lifting equations to effects modelled by applicative functors. It exploits properties of the concrete functor thanks to a modular classification based on combinators. We formalise the meta theory and demonstrate the usability of our Isabelle/HOL package with two...
متن کاملDependent Type Theory of Stateful Higher-Order Functions
In this paper we investigate a logic for reasoning about programs with higher-order functions and effectful features like non-termination and state with aliasing. We propose a dependent type theory HTT (short for Hoare Type Theory), where types serve as program specifications. In case of effectful programs, the type of Hoare triples {P}x:A{Q} specifies the precondition P , the type of the retur...
متن کاملEffectful Applicative Similarity for Call-by-Name Lambda Calculi
We introduce a notion of applicative similarity in which not terms but monadic values arising from the evaluation of effectful terms, can be compared. We prove this notion to be fully abstract whenever terms are evaluated in call-by-name order. This is the first fullabstraction result for such a generic, coinductive methodology for program equivalence.
متن کاملApplicative Lifting
Applicative functors augment computations with effects by lifting function application to types which model the effects [5]. As the structure of the computation cannot depend on the effects, applicative expressions can be analysed statically. This allows us to lift universally quantified equations to the effectful types, as observed by Hinze [3]. Thus, equational reasoning over effectful comput...
متن کاملEffective Reasoning about Effectful Traversals
A recent paper by Graham Hutton and Diana Fulger (‘Reasoning about Effects: Seeing the Wood through the Trees’, Trends in Functional Programming, 2008) addresses the problem of reasoning about effectful functional programs, using a relabelling function on binary trees as a simple example. We argue that their approach is less effective than it might be, because they miss two opportunities for hi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره abs/1801.09072 شماره
صفحات -
تاریخ انتشار 2018